class TeamController < ApplicationController
  
  def pick_team
    @pick = Pick.new
  end
    
  def show_quarterbacks
    @quarterbacks = Player.quarterbacks
  end
  
  def pick_quarterback
    player = Player.find(params[:id])
    @user  = User.last
    @pick  = Pick.new
    @pick.add_player(@user,player)
    redirect_to :action => 'show_receivers'
  end
  
  def show_receivers
    @receivers = Player.receivers
  end
  
  def pick_receiver
    player = Player.find(params[:id])
    @user  = User.last
    @pick  = Pick.new
    @pick.add_player(@user, player)
    redirect_to :action => 'show_defensive_linemen'
  end
  
  def show_defensive_linemen
    @defensive_line = Player.defensive_linemen
  end
  
  def pick_defensive_lineman
    player = Player.find(params[:id])
    @user  = User.last
    @pick  = Pick.new
    @pick.add_player(@user, player)
    redirect_to :action => 'show_cornerbacks'
  end
  
  def show_cornerbacks
    @cornerbacks = Player.cornerbacks
  end
  
  def pick_cornerback
    player = Player.find(params[:id])
    @user  = User.last
    @pick  = Pick.new
    @pick.add_player(@user, player)
    redirect_to :action => 'show_kickers'
  end
  
  def show_kickers
    @kickers = Player.kickers
  end
  
  def pick_kicker
    player = Player.find(params[:id])
    @user  = User.last
    @pick  = Pick.new
    @pick.add_player(@user, player)
    redirect_to :action => 'show'
  end
  
  
  def show
    @user  = User.last
    @picks = @user.picks
    session[:user] = @user
  end
  
  def show_team
    user   = User.find(params[:id])
    @user  = user
    @picks = @user.picks
  end
end
